﻿<RecordOperationSpec 
	xmlns="bb_appfx_recordoperation"
	xmlns:common="bb_appfx_commontypes" 
	ID="0c8edc8b-08d5-43a0-8b4f-4f070583f8ca" 
	Name="Constituent Flag as Organization" 
	Description="Turns on the organization flag for a given constituent id"
	Author="Blackbaud Professional Services"
	OperationType="Update"
	RecordType="Constituent"
	>

	<SPRecord>
		<SPOperationImplementation SPName="USR_USP_FLAG_CONSTITUENT_AS_ORG">
			<common:CreateProcedureSQL>
				<![CDATA[
create procedure dbo.USR_USP_FLAG_CONSTITUENT_AS_ORG
(
  @ID uniqueidentifier
 ,@CHANGEAGENTID uniqueidentifier
)
as begin
  UPDATE CONSTITUENT
  SET
    ISORGANIZATION = 1
   ,CHANGEDBYID = @CHANGEAGENTID
   ,DATECHANGED = GETDATE()
  WHERE ID = @ID;
  return 0;	
end
				]]>
			</common:CreateProcedureSQL>
		</SPOperationImplementation>
	</SPRecord>
</RecordOperationSpec>